import request from './request'

const baseUrl = {
  sysUrl: import.meta.env.VITE_SERVER
}

// sessionApi 获取用户会话的接口
export const sessionApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/session'})
}
// imgCodeApi 获取图形验证码的接口
export const imgCodeApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/common/img-code'})
}
// loginApi 用户登录的接口
export const loginApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/login', data})
}
// uploadApi 上传文件的接口
export const uploadApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/common/upload', headers: {'content-type': 'multipart/form-data'}, data})
}
// delFileApi 删除文件的接口
export const delFileApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/common/delete', data})
}
// selAreasApi 获取省市区的接口
export const selAreasApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/common/areas', params})
}
